package com.jiangnan.api.service

import com.jiangnan.entity.PaymentLog
import com.jiangnan.entity.Res
import retrofit2.http.*

import java.math.BigDecimal

interface PaymentApiService {
  @FormUrlEncoded
  @POST("payment/recharge")
  suspend fun recharge(
    @Field("userId") userId: Long,
    @Field("amount") amount: BigDecimal
  ): Res<BigDecimal>

  @FormUrlEncoded
  @POST("payment/overdue")
  suspend fun payOverdue(
    @Field("userId") userId: Long,
    @Field("amount") amount: BigDecimal
  ): Res<Unit>

  @GET("payment/logs/{userId}")
  suspend fun getLogs(
    @Path("userId") userId: Long
  ): Res<List<PaymentLog>>
}